#ifndef _GE_CONSTANTS_H
#define _GE_CONSTANTS_H

enum GECommand
{
    GE_CMD_NOP,           /* 0x00 */
    GE_CMD_VADDR,         /* 0x01 */
    GE_CMD_IADDR,         /* 0x02 */
    /* 0x03 */
    GE_CMD_PRIM = 0x4,    /* 0x04 */
    GE_CMD_BEZIER,        /* 0x05 */
    GE_CMD_SPLINE,        /* 0x06 */
    GE_CMD_BBOX,          /* 0x07 */
    GE_CMD_JUMP,          /* 0x08 */
    GE_CMD_BJUMP,         /* 0x09 */
    GE_CMD_CALL,          /* 0x0a */
    GE_CMD_RET,           /* 0x0b */
    GE_CMD_END,           /* 0x0c */
    /* 0x0d */
    GE_CMD_SIGNAL = 0x0e, /* 0x0e */
    GE_CMD_FINISH,        /* 0x0f */
    GE_CMD_BASE,          /* 0x10 */
    /* 0x11 */
    GE_CMD_VTYPE = 0x12,  /* 0x12 */
    GE_CMD_OFFSET,        /* 0x13 */
    GE_CMD_ORIGIN,        /* 0x14 */
    GE_CMD_REGION1,       /* 0x15 */
    GE_CMD_REGION2,       /* 0x16 */
    GE_CMD_LTE,           /* 0x17 */
    GE_CMD_LTE0,          /* 0x18 */
    GE_CMD_LTE1,          /* 0x19 */
    GE_CMD_LTE2,          /* 0x1a */
    GE_CMD_LTE3,          /* 0x1b */
    GE_CMD_CPE,           /* 0x1c */
    GE_CMD_BCE,           /* 0x1d */
    GE_CMD_TME,           /* 0x1e */
    GE_CMD_FGE,           /* 0x1f */
    GE_CMD_DTE,           /* 0x20 */
    GE_CMD_ABE,           /* 0x21 */
    GE_CMD_ATE,           /* 0x22 */
    GE_CMD_ZTE,           /* 0x23 */
    GE_CMD_STE,           /* 0x24 */
    GE_CMD_AAE,           /* 0x25 */
    GE_CMD_PCE,           /* 0x26 */
    GE_CMD_CTE,           /* 0x27 */
    GE_CMD_LOE,           /* 0x28 */
    /* 0x29 */
    GE_CMD_BOFS = 0x2a,   /* 0x2a */
    GE_CMD_BONE,          /* 0x2b */
    GE_CMD_MW0,           /* 0x2c */
    GE_CMD_MW1,           /* 0x2d */
    GE_CMD_MW2,           /* 0x2e */
    GE_CMD_MW3,           /* 0x2f */
    GE_CMD_MW4,           /* 0x30 */
    GE_CMD_MW5,           /* 0x31 */
    GE_CMD_MW6,           /* 0x32 */
    GE_CMD_MW7,           /* 0x33 */
    /* 0x34 */
    /* 0x35 */
    GE_CMD_PSUB = 0x36,   /* 0x36 */
    GE_CMD_PPRIM,         /* 0x37 */
    GE_CMD_PFACE,         /* 0x38 */
    /* 0x39 */
    GE_CMD_WMS = 0x3a,    /* 0x3a */
    GE_CMD_WORLD,         /* 0x3b */
    GE_CMD_VMS,           /* 0x3c */
    GE_CMD_VIEW,          /* 0x3d */
    GE_CMD_PMS,           /* 0x3e */
    GE_CMD_PROJ,          /* 0x3f */
    GE_CMD_TMS,           /* 0x40 */
    GE_CMD_TMATRIX,       /* 0x41 */
    GE_CMD_XSCALE,        /* 0x42 */
    GE_CMD_YSCALE,        /* 0x43 */
    GE_CMD_ZSCALE,        /* 0x44 */
    GE_CMD_XPOS,          /* 0x45 */
    GE_CMD_YPOS,          /* 0x46 */
    GE_CMD_ZPOS,          /* 0x47 */
    GE_CMD_USCALE,        /* 0x48 */
    GE_CMD_VSCALE,        /* 0x49 */
    GE_CMD_UOFFSET,       /* 0x4a */
    GE_CMD_VOFFSET,       /* 0x4b */
    GE_CMD_OFFSETX,       /* 0x4c */
    GE_CMD_OFFSETY,       /* 0x4d */
    /* 0x4e */
    /* 0x4f */
    GE_CMD_SHADE = 0x50,  /* 0x50 */
    GE_CMD_RNORM,         /* 0x51 */
    /* 0x52 */
    GE_CMD_CMAT = 0x53,   /* 0x53 */
    GE_CMD_EMC,           /* 0x54 */
    GE_CMD_AMC,           /* 0x55 */
    GE_CMD_DMC,           /* 0x56 */
    GE_CMD_SMC,           /* 0x57 */
    GE_CMD_AMA,           /* 0x58 */
    /* 0x58 */
    /* 0x59 */
    /* 0x5a */
    GE_CMD_SPOW = 0x5b,   /* 0x5b */
    GE_CMD_ALC,           /* 0x5c */
    GE_CMD_ALA,           /* 0x5d */
    GE_CMD_LMODE,         /* 0x5e */
    GE_CMD_LT0,           /* 0x5f */
    GE_CMD_LT1,           /* 0x60 */
    GE_CMD_LT2,           /* 0x61 */
    GE_CMD_LT3,           /* 0x62 */
    GE_CMD_LXP0,          /* 0x63 */
    GE_CMD_LYP0,          /* 0x64 */
    GE_CMD_LZP0,          /* 0x65 */
    GE_CMD_LXP1,          /* 0x66 */
    GE_CMD_LYP1,          /* 0x67 */
    GE_CMD_LZP1,          /* 0x68 */
    GE_CMD_LXP2,          /* 0x69 */
    GE_CMD_LYP2,          /* 0x6a */
    GE_CMD_LZP2,          /* 0x6b */
    GE_CMD_LXP3,          /* 0x6c */
    GE_CMD_LYP3,          /* 0x6d */
    GE_CMD_LZP3,          /* 0x6e */
    GE_CMD_LXD0,          /* 0x6f */
    GE_CMD_LYD0,          /* 0x70 */
    GE_CMD_LZD0,          /* 0x71 */
    GE_CMD_LXD1,          /* 0x72 */
    GE_CMD_LYD1,          /* 0x73 */
    GE_CMD_LZD1,          /* 0x74 */
    GE_CMD_LXD2,          /* 0x75 */
    GE_CMD_LYD2,          /* 0x76 */
    GE_CMD_LZD2,          /* 0x77 */
    GE_CMD_LXD3,          /* 0x78 */
    GE_CMD_LYD3,          /* 0x79 */
    GE_CMD_LZD3,          /* 0x7a */
    GE_CMD_LCA0,          /* 0x7b */
    GE_CMD_LLA0,          /* 0x7c */
    GE_CMD_LQA0,          /* 0x7d */
    GE_CMD_LCA1,          /* 0x7e */
    GE_CMD_LLA1,          /* 0x7f */
    GE_CMD_LQA1,          /* 0x80 */
    GE_CMD_LCA2,          /* 0x81 */
    GE_CMD_LLA2,          /* 0x82 */
    GE_CMD_LQA2,          /* 0x83 */
    GE_CMD_LCA3,          /* 0x84 */
    GE_CMD_LLA3,          /* 0x85 */
    GE_CMD_LQA3,          /* 0x86 */
    GE_CMD_SLE0,          /* 0x87 */
    GE_CMD_SLE1,          /* 0x88 */
    GE_CMD_SLE2,          /* 0x89 */
    GE_CMD_SLE3,          /* 0x8a */
    GE_CMD_SLCO0,         /* 0x8b */
    GE_CMD_SLCO1,         /* 0x8c */
    GE_CMD_SLCO2,         /* 0x8d */
    GE_CMD_SLCO3,         /* 0x8e */
    GE_CMD_ALC0,          /* 0x8f */
    GE_CMD_DLC0,          /* 0x90 */
    GE_CMD_SLC0,          /* 0x91 */
    GE_CMD_ALC1,          /* 0x92 */
    GE_CMD_DLC1,          /* 0x93 */
    GE_CMD_SLC1,          /* 0x94 */
    GE_CMD_ALC2,          /* 0x95 */
    GE_CMD_DLC2,          /* 0x96 */
    GE_CMD_SLC2,          /* 0x97 */
    GE_CMD_ALC3,          /* 0x98 */
    GE_CMD_DLC3,          /* 0x99 */
    GE_CMD_SLC3,          /* 0x9a */
    GE_CMD_FFACE,         /* 0x9b */
    GE_CMD_FBP,           /* 0x9c */
    GE_CMD_FBW,           /* 0x9d */
    GE_CMD_ZBP,           /* 0x9e */
    GE_CMD_ZBW,           /* 0x9f */
    GE_CMD_TBP0,          /* 0xa0 */
    GE_CMD_TBP1,          /* 0xa1 */
    GE_CMD_TBP2,          /* 0xa2 */
    GE_CMD_TBP3,          /* 0xa3 */
    GE_CMD_TBP4,          /* 0xa4 */
    GE_CMD_TBP5,          /* 0xa5 */
    GE_CMD_TBP6,          /* 0xa6 */
    GE_CMD_TBP7,          /* 0xa7 */
    GE_CMD_TBW0,          /* 0xa8 */
    GE_CMD_TBW1,          /* 0xa9 */
    GE_CMD_TBW2,          /* 0xaa */
    GE_CMD_TBW3,          /* 0xab */
    GE_CMD_TBW4,          /* 0xac */
    GE_CMD_TBW5,          /* 0xad */
    GE_CMD_TBW6,          /* 0xae */
    GE_CMD_TBW7,          /* 0xaf */
    GE_CMD_CBP,           /* 0xb0 */
    GE_CMD_CBPH,          /* 0xb1 */
    GE_CMD_TRXSBP,        /* 0xb2 */
    GE_CMD_TRXSBW,        /* 0xb3 */
    GE_CMD_TRXDBP,        /* 0xb4 */
    GE_CMD_TRXDBW,        /* 0xb5 */
    /* 0xb6 */
    /* 0xb7 */
    GE_CMD_TSIZE0 = 0xb8, /* 0xb8 */
    GE_CMD_TSIZE1,        /* 0xb9 */
    GE_CMD_TSIZE2,        /* 0xba */
    GE_CMD_TSIZE3,        /* 0xbb */
    GE_CMD_TSIZE4,        /* 0xbc */
    GE_CMD_TSIZE5,        /* 0xbd */
    GE_CMD_TSIZE6,        /* 0xbe */
    GE_CMD_TSIZE7,        /* 0xbf */
    GE_CMD_TMAP,          /* 0xc0 */
    GE_CMD_TSHADE,        /* 0xc1 */
    GE_CMD_TMODE,         /* 0xc2 */
    GE_CMD_TPSM,          /* 0xc3 */
    GE_CMD_CLOAD,         /* 0xc4 */
    GE_CMD_CMODE,         /* 0xc5 */
    GE_CMD_TFLT,          /* 0xc6 */
    GE_CMD_TWRAP,         /* 0xc7 */
    GE_CMD_TBIAS,         /* 0xc8 */
    GE_CMD_TFUNC,         /* 0xc9 */
    GE_CMD_TEC,           /* 0xca */
    GE_CMD_TFLUSH,        /* 0xcb */
    GE_CMD_TSYNC,         /* 0xcc */
    GE_CMD_FFAR,          /* 0xcd */
    GE_CMD_FDIST,         /* 0xce */
    GE_CMD_FCOL,          /* 0xcf */
    GE_CMD_TSLOPE,        /* 0xd0 */
    /* 0xd1 */
    GE_CMD_PSM = 0xd2,    /* 0xd2 */
    GE_CMD_CLEAR,         /* 0xd3 */
    GE_CMD_SCISSOR1,      /* 0xd4 */
    GE_CMD_SCISSOR2,      /* 0xd5 */
    GE_CMD_MINZ,          /* 0xd6 */
    GE_CMD_MAXZ,          /* 0xd7 */
    GE_CMD_CTST,          /* 0xd8 */
    GE_CMD_CREF,          /* 0xd9 */
    GE_CMD_CMSK,          /* 0xda */
    GE_CMD_ATST,          /* 0xdb */
    GE_CMD_STST,          /* 0xdc */
    GE_CMD_SOP,           /* 0xdd */
    GE_CMD_ZTST,          /* 0xde */
    GE_CMD_ALPHA,         /* 0xdf */
    GE_CMD_SFIX,          /* 0xe0 */
    GE_CMD_DFIX,          /* 0xe1 */
    GE_CMD_DTH0,          /* 0xe2 */
    GE_CMD_DTH1,          /* 0xe3 */
    GE_CMD_DTH2,          /* 0xe4 */
    GE_CMD_DTH3,          /* 0xe5 */
    GE_CMD_LOP,           /* 0xe6 */
    GE_CMD_ZMSK,          /* 0xe7 */
    GE_CMD_PMSKC,         /* 0xe8 */
    GE_CMD_PMSKA,         /* 0xe9 */
    GE_CMD_TRXKICK,       /* 0xea */
    GE_CMD_TRXSPOS,       /* 0xeb */
    GE_CMD_TRXDPOS,       /* 0xec */
    /* 0xed */
    GE_CMD_TRXSIZE = 0xee /* 0xee */
};

#define GE_VTYPE_TC_NONE  0
#define GE_VTYPE_TC_8BIT  1
#define GE_VTYPE_TC_16BIT 2
#define GE_VTYPE_TC_FLOAT 3
#define GE_VTYPE_TC_MASK  (3 << 0)
#define GE_VTYPE_TC_SHIFT 0

#define GE_VTYPE_COL_NONE 0
#define GE_VTYPE_COL_565  4
#define GE_VTYPE_COL_5551 5
#define GE_VTYPE_COL_4444 6
#define GE_VTYPE_COL_8888 7
#define GE_VTYPE_COL_MASK (7 << 2)
#define GE_VTYPE_COL_SHIFT 2

#define GE_VTYPE_NRM_NONE  0
#define GE_VTYPE_NRM_8BIT  1
#define GE_VTYPE_NRM_16BIT 2
#define GE_VTYPE_NRM_FLOAT 3
#define GE_VTYPE_NRM_MASK  (3 << 5)
#define GE_VTYPE_NRM_SHIFT 5

#define GE_VTYPE_POS_8BIT  1
#define GE_VTYPE_POS_16BIT 2
#define GE_VTYPE_POS_FLOAT 3
#define GE_VTYPE_POS_MASK  (3 << 7)
#define GE_VTYPE_POS_SHIFT 7

#define GE_VTYPE_WEIGHT_NONE  0
#define GE_VTYPE_WEIGHT_8BIT  1
#define GE_VTYPE_WEIGHT_16BIT 2
#define GE_VTYPE_WEIGHT_FLOAT 3
#define GE_VTYPE_WEIGHT_MASK  (3 << 9)
#define GE_VTYPE_WEIGHT_SHIFT 9

#define GE_VTYPE_IDX_NONE  0
#define GE_VTYPE_IDX_8BIT  1
#define GE_VTYPE_IDX_16BIT 2
#define GE_VTYPE_IDX_MASK  (3 << 11)
#define GE_VTYPE_IDX_SHIFT 11

#define GE_VTYPE_NWEIGHT_MASK  (7 << 14)
#define GE_VTYPE_NWEIGHT_SHIFT 14

#define GE_VTYPE_NMORPH_MASK  (7 << 18)
#define GE_VTYPE_NMORPH_SHIFT 18

#define GE_VTYPE_THROUGH_MASK  (1 << 23)
#define GE_VTYPE_THROUGH_SHIFT 23

#define GE_BEHAVIOR_SUSPEND  1
#define GE_BEHAVIOR_CONTINUE 2

typedef enum
{
    GE_LIGHTTYPE_DIRECTIONAL,
    GE_LIGHTTYPE_POINT,
    GE_LIGHTTYPE_SPOT
} GELightType;

typedef enum
{
    GE_LIGHTCOMP_ONLYDIFFUSE,
    GE_LIGHTCOMP_BOTH,
    GE_LIGHTCOMP_BOTHWITHPOWDIFFUSE
} GELightComputation;

typedef enum
{
    GE_TFMT_5650,
    GE_TFMT_5551,
    GE_TFMT_4444,
    GE_TFMT_8888,
    GE_TFMT_CLUT4,
    GE_TFMT_CLUT8,
    GE_TFMT_CLUT16,
    GE_TFMT_CLUT32,
    GE_TFMT_DXT1,
    GE_TFMT_DXT3,
    GE_TFMT_DXT5
} GETextureFormat;

typedef enum
{
    GE_CMODE_16BIT_BGR5650,
    GE_CMODE_16BIT_ABGR5551,
    GE_CMODE_16BIT_ABGR4444,
    GE_CMODE_32BIT_ABGR8888
} GEPaletteFormat;

typedef enum
{
    GE_PRIM_POINTS,
    GE_PRIM_LINES,
    GE_PRIM_LINE_STRIP,
    GE_PRIM_TRIANGLES,
    GE_PRIM_TRIANGLE_STRIP,
    GE_PRIM_TRIANGLE_FAN,
    GE_PRIM_SPRITES
} GEPrimitiveType;

typedef enum
{
    GE_TFUNC_MODULATE,
    GE_TFUNC_DECAL,
    GE_TFUNC_BLEND,
    GE_TFUNC_REPLACE,
    GE_TFUNC_ADD,
    GE_TFUNC_UNKNOWN1,
    GE_TFUNC_UNKNOWN2,
    GE_TFUNC_UNKNOWN3
} GETfuncType;

typedef enum
{
    GE_SHADE_FLAT,
    GE_SHADE_SMOOTH
} GEShadeModel;

typedef enum
{
    GE_FRONTFACE_CW,
    GE_FRONTFACE_CCW
} GEFrontFaceType;

typedef enum
{
    GE_ZTEST_NEVER,
    GE_ZTEST_ALWAYS,
    GE_ZTEST_EQUAL,
    GE_ZTEST_NOTEQUAL,
    GE_ZTEST_LESS,
    GE_ZTEST_LEQUAL,
    GE_ZTEST_GREATER,
    GE_ZTEST_GEQUAL
} GEZTest;

#define GE_FIX 10

#define GE_FIX_BLEND_COLOR           10
#define GE_FIX_BLEND_ONE_MINUS_COLOR 11
#define GE_FIX_BLACK                 12
#define GE_FIX_WHITE                 13

typedef enum
{   
    GE_BLEND_FUNCTION_ADD,
    GE_BLEND_FUNCTION_SUBTRACT,
    GE_BLEND_FUNCTION_REVERSE_SUBTRACT,
    GE_BLEND_FUNCTION_MIN,
    GE_BLEND_FUNCTION_MAX,
    GE_BLEND_FUNCTION_ABSOLUTE
} GEBlendFunction;

typedef enum
{
    GE_ALPHA_FUNCTION_NEVER,
    GE_ALPHA_FUNCTION_ALWAYS,
    GE_ALPHA_FUNCTION_EQUAL,
    GE_ALPHA_FUNCTION_NOTEQUAL,
    GE_ALPHA_FUNCTION_LESS,
    GE_ALPHA_FUNCTION_LEQUAL,
    GE_ALPHA_FUNCTION_GREATER,
    GE_ALPHA_FUNCTION_GEQUAL
} GEAlphaFunction;

#endif
